package com.chushouya.order.constants;



import com.general.framework.core.enums.IEnum;
import com.general.framework.core.lang.Strings;

import java.util.Objects;

/**
 * 订单物流状态枚举
 * -1无 0:用户寄件 1:给用户退货 2:业务员回寄
 */
public enum LogisticsTypeEnum implements IEnum<Integer> {
    NONE(-1, "无"),
    USER_SEND(0, "用户寄件"),
    //给用户退货
    USER_RETURN(1, "用户退货"),
    //业务员回寄
    CLERK_SEND(2, "业务员寄");
    private Integer value;

    private String desc;

    LogisticsTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (LogisticsTypeEnum thisEnum : LogisticsTypeEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum.desc;
            }
        }
        return Strings.EMPTY;
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
